Stress, which is most common part of contemporary life, can have a serious negative effect on a person\'s physical and mental health. Determining and tracking stress levels is therefore essential to improving general health and quality of life. This offers a cutting-edge and successful method for determining a person\'s degree of stress by looking at how they sleep. Utilizing the robust features of the Python programming language, the research makes use of the Random Forest Classifier algorithm, which is renowned for its adaptability and precision in classification assignments .The primary objective is to develop a reliable stress detection system more that can provide insightful data about people\'s stress levels, enabling timely interventions and promoting improved mental health. Numerous significant variables related to stress levels and sleep patterns are included in the data set that was carefully chosen for the study. The user\'s snoring range, respiration rate, body temperature, limb movement rate, blood oxygen levels, eye movement, heart rate, number of hours slept, and stress levels—which are divided into five classes—are among these parameters. The classes are 0 (low/normal), 1 (medium low), 2 (medium), 3 (medium high), and 4 (high). By including these several criteria, a thorough examination of sleep patterns and their relationship to stress levels is ensured. The model was able to learn complex patterns from the data set and forecast stress accurately based on the user\'s sleeping patterns, as seen by the high accuracy that was attain. Research and treatments in medicine as well as personal health monitoring are just a few of the many possible uses for this stress detection system. People can take proactive steps to reduce stress, enhance sleep quality, and promote general well being by using the system to analyze their sleep patterns and receive insights into their stress levels.
Introduction
The text focuses on stress detection using machine learning, particularly by analyzing sleeping habits and physiological data. Stress is described as a natural response to internal and external pressures, but chronic stress can negatively affect health. Biological responses such as increased heart rate and hormone release (cortisol, adrenaline) are key indicators of stress.
The study aims to analyze the relationship between sleep patterns and stress levels and develop a system that can accurately predict stress using machine learning models like Random Forest and Naïve Bayes. With the help of wearable devices and health monitoring systems, large-scale physiological and behavioral data (e.g., sleep duration, heart rate, respiration) can be collected for analysis.
The literature review shows that existing systems use:
Algorithms such as SVM, fuzzy logic, and deep learning
to detect and classify stress levels. These systems support real-time monitoring, personalized insights, and early intervention.
The proposed methodology includes:
Collecting a dataset (from Kaggle) with features like sleep hours, heart rate, body temperature, and oxygen levels,
Cleaning and preparing the data,
Splitting it into training (80%) and testing (20%) sets,
Applying machine learning models.
Among the tested models, the Random Forest Classifier achieved the best performance with 97.6% accuracy.
Overall, the system provides an efficient, data-driven approach to stress detection, enabling early identification and proactive mental health management through sleep behavior analysis.
Conclusion
In the area of stress management and sleep analysis, the \"Human Stress Detection Based on Sleeping Habits Using Machine Learning with Random Forest Classifier\" study is significant. The research attempts to accurately estimate human stress levels based on sleeping habits by implementing the Random Forest Classifier algorithm and carefully taking into account various sleep-related data.
Better accuracy, resilience to outliers, and the capacity to manage non-linear correlations between stress levels and sleep metrics are just a few of the benefits that the suggested approach offers over the current one. Utilizing feature importance analysis and continual learning, the system guarantees flexibility to evolving sleep patterns over time and offers insightful predictions of stress levels. The initiative streamlines the data through a number of clearly defined modules.At the heart of the system is the Random Forest Classifier module, which uses a group of decision trees to classify stress levels in an accurate and well-informed manered.
References
[1] F. Akhtar, M. B. Bin Heyat, J. P. Li, P. K. Patel, Rishipal and B. Guragai, \"Role of Machine Learning in Human Stress: A Review\", 2020 17th Int. Comput. Conf. Wavelet Act. Media Technol. Inf. Process. ICCWAMTIP 2020, pp. 170-174, 2020.
[2] W. Wang, Y. Zhao, Y. J. Wu, and M. Goh, ‘‘Factors of dropout from MOOCs: A bibliometric review,’’ Library Hi Tech, vol. 41, no. 2, pp. 432– 453, Jun. 2023.
[3] A. M. Shahsavarani, E. A. M. Abadi and M. H. Kalkhoran, \"Stress Assessment and Development of a Primary Care of Psychology Service\", Int. J. Med. Rev., vol. 2, no. 2, pp. 230-241, 2014.
[4] A. Khademi, Y. El-Manzalawy, L. Master, O. M. Buxton and V. G. Honavar, \"Personalized sleep parameters estimation from actigraphy: A machine learning approach\", Nat. Sci. Sleep, vol. 11, pp. 387- 399, 2019.
[5] L. Rachakonda, A. K. Bapatla, S. P. Mohanty and E. Kougianos, \"SaYoPillow: Blockchain- Integrated Privacy-Assured IoMT Framework for Stress Management Considering Sleeping Habits\", IEEE Trans. Consum. Electron., vol. 67, no. 1, pp. 20-29, 2021
[6] A. R. Subhani, W. Mumtaz, M. N. B. M. Saad, N. Kamel and A. S. Malik, \"Machine learning framework for the detection of mental stress at multiple levels\", IEEE Access, vol. 5, no. c, pp. 13545-13556, 2017.
[7] A. Muhammad, Q. Zhou, G. Beydoun, D. Xu, and J. Shen, ‘‘Learning path adaptation in online learning systems,’’ in Proc. IEEE 20th Int. Conf. Comput. Supported Cooperat. Work Design (CSCWD), May 2016, pp. 421–426.
[8] E. Garcia-Ceja, M. Riegler, T. Nordgreen, P. Jakobsen, K. J. Oedegaard and J. Tørresen, \"Mental health monitoring with multimodal sensing and machine learning: A survey\", Pervasive Mob. Comput., vol. 51, pp. 1-26, 2018.
[9] L. Meng, W. Zhang, Y. Chu, and M. Zhang, ‘‘LD–LP generation of personalized learning path based on learning diagnosis,’’ IEEE Trans. Learn. Technol., vol. 14, no. 1, pp. 122–128, Feb. 2021.
[10] E. Garcia-Ceja, M. Riegler, T. Nordgreen, P. Jakobsen, K. J. Oedegaard and J. Tørresen, \"Mental health monitoring with multimodal sensing and machine learning: A survey\", Pervasive Mob. Comput., vol. 51, pp. 1-26, 2018.
[11] A. R. Subhani, W. Mumtaz, M. N. B. M. Saad, N. Kamel and A. S. Malik, \"Machine learning framework for the detection of mental stress at multiple levels\", IEEE Access, vol. 5, no. c, pp. 13545-13556, 2017.
[12] V. C. Magana and M. Munoz-Organero, \"Reducing stress on habitual journeys\", 5th IEEE Int. Conf. Consum. Electron. - Berlin ICCE-Berlin 2015, pp. 153-157, 2016.
[13] N. Schneiderman, G. Ironson and S. D. Siegel, \"Stress and health: Psychological behavioral and biological determinants\", Annu. Rev. Clin. Psychol., vol. 1, pp. 607-628, 2005
[14] Smith et al., \"Smart-Pillow: An IoT Based Device for Stress Detection Considering Sleeping Habits,\" IEEE Conference on IoT Solutions, 2019.
[15] Y. Zhao et al., \"Advancing Stress Prediction Through Multi-Modal Sleep Analysis,\" IEEE Transactions on Affective Computing, 2021
[16] N. Hidayat, R. Wardoyo, A. Sn, and H. Dwi, ‘‘Enhanced performance of the automatic learning style detection model using a combination of modified K-means algorithm and naive Bayesian,’’ Int. J. Adv. Comput. Sci. Appl., vol. 11, no. 3, pp. 638–648, 2020.
[17] N. T. Nghe, P. Janecek, and P. Haddawy, ‘‘A comparative analysis of techniques for predicting academic performance,’’ in Proc. 37th Annu. Frontiers Educ. Conf. Global Eng., Knowl. Without Borders, Opportunities Without Passports, Oct. 2007, p. 7.
[18] R. Patel et al., \"Machine Learning in Sleep Monitoring and Stress Detection,\" IEEE International Conference on Smart Healthcare, 2020
[19] J. L. Rastrollo-Guerrero, J. A. Gómez-Pulido, and A. Durán-Domínguez, ‘‘Analyzing